var stackPid: integer; begin stackPid := getMemo('stackPid'); end; macro 'make stack'; begin setNewSize(512,100); makeNewStack('stack'); stackPid := pidNumber; setMemo('stackPid',stackPid); end; macro 'front image is stack'; begin stackPid := pidNumber; setMemo('stackPid',stackPid); end; macro '[F15]copy molecule to stack'; var left, top, width, height: integer; tempPid, srPid: integer; pwidth, pheight: integer; swidth, sheight: integer; s: string; begin SetCounter(513); SetOptions('X-Y Center,angle'); Measure; if rAngle[rCount] > 90 then rAngle[rCount] := rAngle[rCount] - 180; InsetRoi(-10); GetRoi(left, top, width, height); if width < height then begin top := top - height/4; height := height + height/2; end else begin left := left - width / 4; width := width + width/2; end; MakeRoi(left, top,width, height); InsetRoi(-10); Duplicate('temp'); tempPid := pidNumber; if width < height then begin rotateLeft(true); rAngle[rCount] := rAngle[rCount] + 90; srPid := pidNumber; if pidExists(tempPid) then begin choosePic(tempPid); dispose; end; tempPid := srPid; choosePic(tempPid); end; SetScaling('Bilinear,New Window'); {SetScaling('New Window');} ScaleAndRotate(1,1,rAngle[rCount]); srPid := pidNumber; ChoosePic(tempPid); Dispose; SelectPic(srPid); GetPicSize(pWIdth, pHeight); ChoosePic(stackPid); GetPicSize(sWidth, sHeight); SelectPic(srPid); SelectAll; Copy; Dispose; SelectPic(stackPid); SelectSlice(nSlices); AddSlice; Paste; ChoosePic(raw16Pid); s := GetPicName; ChoosePic(stackPid); MoveTo(10,10); WriteLn(s); WriteLn(top); WriteLn(left); SelectPic(Proc8Pid); SetDensitySlice(255,255); end;